import Vue from "vue"
import VueX from "vuex"

import defaultState from "./state"
import mutations from "./mutations"
import getters from "./getters"
import actions from "./actions"

Vue.use(VueX)

export default new VueX.Store({
  //state状态
  state: defaultState,
  //辅助函数, 对列表进行过滤并计数
  getters,
  //唯一改变state状态的方法 , 同步操作
  mutations,
  //调用mutations改变state状态, 异步操作
  actions
})
